package cn.iocoder.yudao.module.ao.dal.mysql.subjectgroup;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.ao.dal.dataobject.subjectgroup.SubjectGroupDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.ao.controller.admin.subjectgroup.vo.*;

/**
 * 学科组信息 Mapper
 *
 * @author 禾安
 */
@Mapper
public interface SubjectGroupMapper extends BaseMapperX<SubjectGroupDO> {

    default PageResult<SubjectGroupDO> selectPage(SubjectGroupPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<SubjectGroupDO>()
                .eqIfPresent(SubjectGroupDO::getDeptId, reqVO.getDeptId())
                .likeIfPresent(SubjectGroupDO::getGroupName, reqVO.getGroupName())
                .eqIfPresent(SubjectGroupDO::getGroupCode, reqVO.getGroupCode())
                .eqIfPresent(SubjectGroupDO::getGroupLeaderId, reqVO.getGroupLeaderId())
                .eqIfPresent(SubjectGroupDO::getDescription, reqVO.getDescription())
                .eqIfPresent(SubjectGroupDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(SubjectGroupDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(SubjectGroupDO::getGroupId));
    }

}